package com.weipai.demo.controller;

import com.weipai.demo.model.ApplyforLoans;
import com.weipai.demo.service.ApplyforLoansService;
import com.weipai.demo.util.LayuiTablePagingResult;
import com.weipai.demo.util.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @Author: 赵项阳
 * @Date: 2019/6/28 17:38
 * @Version 1.0
 */
@RestController
public class ApplyforLoansController {


    @Autowired
    private ApplyforLoansService applyforLoansService;

    //页面用户申请贷款
    @RequestMapping(value = "/loans/applyFor")
    public Response applyFor(ApplyforLoans applyforLoans){

        return applyforLoansService.applyFor(applyforLoans);
    }

    //展示贷款信息
    @RequestMapping(value = "/loans/showApplyfor")
    public LayuiTablePagingResult showApplyfor(Integer page,Integer size){
       return applyforLoansService.showApplyFor(page,size);
    }

    //申请用户是否通过审核
    @RequestMapping(value = "/loans/audit")
    public Response audit(Integer id,Integer status){
        return applyforLoansService.audit(id,status);
    }
    //申请贷款用户删除
    @RequestMapping(value = "/loans/delete")
    public Response delete(Integer id){
        return applyforLoansService.delete(id);
    }

    //图片随机点击
    @RequestMapping(value = "/loans/dynamic")
    public Response dynamic(HttpServletRequest request, HttpServletResponse response){
        return applyforLoansService.dynamic(request,response);
    }


}
